-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Do not copy .rmeta files into the sysroot of the build compiler during check of rustc/std #144252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
This comment has been minimized.
This comment has been minimized.
nit: s/hcekc/check in the PR title |
I will also need to do this for the Clippy steps. |
Uhh, |
This helps to avoid polluting the sysroot of the build compiler.
This should be ready for a review now. |
The job Click to see the possible cause of the failure (guessed by this bot)
|
aur naur |
Before, when bootstrap did a check build of rustc stage N (with a build compiler that was stage N-1), it automatically copied the resulting
.rmeta
artifacts into the sysroot of the stage N-1 build compiler, so that stage Nrustc_private
tools such asmiri
could be compiled using the stage N-1 build compiler. This has a number of issues:rustc_private
tools were actually built.check::Std
actually doesn't copy the artifacts anymore (which forced us to build std instead of just checking it in a bunch ofCheck
steps).Based on suggestions by @cuviper and @bjorn3, I tried to change how this behaves. Instead of copying the rmeta artifacts into the sysroot of the build compiler (from where they would be loaded implicitly), they are now stored in a separate transient bootstrap build directory, and they are then explicitly passed only when checking
rustc_private
tools using the-L
flag. The flags are passed out-of-band through our rustc wrapper, to avoid invalidating the build cache. This is the first commit.The second commit does the same for std. For a few months, we used to build std instead of just checking it when doing a cross-compile check of something that required std, this now fixes it. There is still the previous ordering requirement though, that
check::Std
has to be executed as the last check step, or rather nothing that requires checked std should be executed after it, because it will run into rmeta/rlib duplications (rust/src/bootstrap/src/core/builder/mod.rs
Line 1066 in 4fa90ef
stage0-sysroot
.Based on my local tests, this seems to be working fine. If it works on CI, and we don't run into other issues after merging it, I'd like to do the same also for rlib artifacts generated during
x build
.r? @jieyouxu